var express = require('express');
var router = new express.Router();
var path = require('path');
var fs = require('fs');




router.post('/upload',function(req,res){

    var filename =req.files[0].path +path.parse(req.files[0].originalname).ext

    console.log(filename);

    fs.rename(req.files[0].path,filename,function(err){

        res.send({filename:filename});

    })
  
})


module.exports = router;